//Product.java
package shoppingcart;

import java.io.Serializable;

/**
 * @author fhzheng
 * <h1>产品实体</h1>
 * <h1>javabean编写规范</h1>
 * <li> 1.属性私有，建议采用包装类型
 * <li> 2.访问器公有，标准的setter/getter驼峰命名形式，故属性名应大于2个字母，不应出现首2字母为大写的情况
 * <li> 3.有无参构造方法
 * <li> 4.实现Serializable接口
 * <li> 5.可以有多参或全参构造方法
 * <li> 6.可以有toString等对象信息展示方法
 */
public class Product implements Serializable {
	
	/**
	 * <li>属性 
	 */
	private static final long serialVersionUID = 1L;
	private String id;				//商品标识
	private String name;			//商品名称
	private String description;		//商品描述
	private double price;			//商品价格
	private int num;				//商品数量-即库存
	
	public Product(){ }
	
	public Product(
			String id,
			String name,
			String description,
			double price,
			int num){
		this.id=id;
		this.name=name;
		this.description=description;
		this.price=price;
		this.num=num;
	}
	
	public String getId() {
		return (this.id);
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return (this.name);
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return (this.description);
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public double getPrice() {
		return (this.price);
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public int getNum() {
		return (this.num);
	}
	public void setNum(int num) {
		this.num = num;
	}

	@Override
	public String toString() {
		return "Product [id=" + id + ", name=" + name + ", description=" + description + ", price=" + price + ", num="
				+ num + "]";
	}
	
	
}
